package pe.edu.unmsm.fisi.sisconteg.repository.dao.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import pe.edu.unmsm.fisi.sisconteg.domain.model.Certificado;
import pe.edu.unmsm.fisi.sisconteg.repository.dao.CertificadoDAO;

@Repository
public class CertificadoDAOImpl implements CertificadoDAO {

	@Autowired
	private SessionFactory sessionFactory;

	@SuppressWarnings("unchecked")
	@Override
	public List<Certificado> listCertificados() throws DataAccessException {
		return sessionFactory.getCurrentSession()
				.createCriteria(Certificado.class).list();
	}

}
